// index page
// ============

define(['require', 'zepto', 'wx', 'sui'], function(require, $, wx) {
  return {
    init: function(data) {
      this.initPage(data.jsConfig)
    },
    initPage: function(config) {
      
      var isDebug = location.search.indexOf('debug=true') > 0;
      
      wx.config({
        debug: isDebug,
        appId: config.appid,
        timestamp: config.timestamp,
        nonceStr: config.nonce_str,
        signature: config.signature,
        jsApiList: ['startRecord', 'stopRecord', 'onVoiceRecordEnd',
                    'playVoice', 'pauseVoice', 'stopVoice', 'onVoicePlayEnd',
                    'uploadVoice', 'downloadVoice']
      });
      
      wx.ready(function(){
        document.getElementById('testVedio').play(); //视频自动播放
      });
    }
  }
})